import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
// 引入Element Plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 引入Element Plus暗黑模式样式
import 'element-plus/theme-chalk/dark/css-vars.css'
// 引入中文语言包
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// 引入Element Plus图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 引入ECharts
import * as echarts from 'echarts'
const app = createApp(App)
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 全局挂载echarts
app.config.globalProperties.$echarts = echarts
// 使用Element Plus并配置中文语言
app.use(ElementPlus, {
  locale: zhCn,
})
app.mount('#app')
